package SHIYAN;
public class SHIYAN1 {
    public static void main (String[] args) {
        int n = 1;
        int count = 0;
        for (; n <= 1000; n++) {
            int flag = 1;
            for (int i = 2; i < n-1; i++) {
                if (n % i == 0) {
                    flag = 0;
                    break;
                }
            }
            if(flag == 1)
            {
                System.out.print(n+" ");
                count++;
                if(count % 20 == 0) {
                    System.out.println("\n");
                }
            }
        }
    }
}
